#include<iostream>
#include<cmath>
using namespace std;
//求一元二次的根，初中知识，不赘诉
class Equation
{
    private:
        double a,b,c;
    public:
        Equation(double _a=1.0,double _b=1.0,double _c=0):a(_a),b(_b),c(_c){ }
        void set(double _a,double _b,double _c)
        {
            a=_a;
            b=_b;
            c=_c;
        }
        void getRoot(double &ans1,double &ans2,double &com1,double &com2)
        {
            double tmp=b*b-4*a*c;
            if(fabs(tmp)<=0.000001)
            {
                ans1=-b/(2*a);
                ans2=-b/(2*a);
            }
            else if(tmp>0)
            {
                ans1=(-b+sqrt(tmp))/(2*a);
                ans2=(-b-sqrt(tmp))/(2*a);
            }
            else
            {
                tmp=-tmp;
                com1=sqrt(tmp)/(2*a);
                com2=-sqrt(tmp)/(2*a);
                ans1=-b/(2*a);
                ans2=-b/(2*a);
            }
        }


};
int main()
{
    int t;
    cin>>t;
    while(t--)
    {

        double a,b,c;
        cin>>a>>b>>c;
        Equation num(a,b,c);
        double ans1=0,ans2=0,com1=0,com2=0;
        num.getRoot(ans1,ans2,com1,com2);
        if(fabs(com1)<=0.000001)
        {
            if(ans1==ans2)
            {
                printf("x1=x2=%.2f\n",ans1);
            }
            else
            {
                printf("x1=%.2f x2=%.2f\n",ans1,ans2);
            }
        }
        else
        {
            printf("x1=%.2f+%.2fi x2=%.2f%.2fi\n",ans1,com1,ans2,com2);
        }
    }
}